<style>
/* Table */
.table thead th, .table td {
	text-align: center;
    vertical-align: middle;
}
.table tbody tr.gray > td,
.table thead tr > th {
    background-color: #cdcdcd;
    height: 40px;
}
.table tr.expand {
	display: none;
	background-color: #cdcdcd;
}
.table tr.expand td {
	padding: 16px 16px 0;
}
</style>
<?php if ($this->session->flashdata('success_msg')): ?>
  <?php echo '<span class="alert alert-success">' . $this->session->flashdata('success_msg') . '</span>'; ?>
<?php endif; ?>
  
<a class="btn" href="<?php echo base_url("advertising/index/add"); ?>">Tạo mới quảng cáo</a>  
  
<?php if($advertising_arr): ?>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th id="name" width="320">Tên chiến dịch</th>
        <th id="type" width="210">Loại hình</th> 
        <th id="position" width="210">Vị trí</th> 
        <th id="cost" width="210">Ngân sách</th> 
        <th id="bid" width="210">Giá thầu</th> 
        <th id="edit&remove"></th>
      </tr>
    </thead>
    <tbody>
    <?php foreach ($advertising_arr as $advertising): ?>
      <tr>
        <td headers="name"><?php echo $advertising['name']; ?></td>
        <td headers="type"><?php echo Config_type_helper::get_label($advertising['type']); ?></td>
        <td headers="position"><?php echo Config_position_helper::get_label($advertising['position']); ?></td>
        <td headers="cost"><?php echo $advertising['cost']; ?></td>
        <td headers="edit&remove">
          <a class="btn btn-primary" href="<?php echo base_url("booth_product_categories/edit/{$advertising['id']}"); ?>">Sửa</a>
          <a class="btn btn-primary" href="<?php echo base_url("booth_product_categories/remove/{$advertising['id']}"); ?>">Xóa</a>  
        </td>
      </tr>
    <?php endforeach; ?>
    </tbody>
  </table>  
<?php else: ?>
  Không tồn tại
<?php endif; ?>